package libary;
import java.util.ArrayList;
import java.util.Scanner;
public class book {
    public static void main(String[] args) {
        libary1[] kk = new libary1[3];
        libary1 c1 = new libary1(1, "one", 23);
        libary1 c2 = new libary1(2, "two", 24);
        libary1 c3 = new libary1(3, "three", 25);
        ArrayList<libary1> list = new ArrayList<>() ;
        list.add(c1);
        list.add(c2);
        list.add(c3);

        //kk[0] = c1;
        //kk[1] = c2;
        //kk[2] = c3;

//        for(libary1 x:kk){
//            if (x.id==2){
//                x.time++;
//                //改
//            }
//            }
        libary1 c4 = new libary1(4,"for",26);
        list.add(c4);
        //增
        for (libary1 x:list){
            if (x.id==1){
                c1=null;
                //删
            }
        }Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你想查找的书的id");
        int a = scanner.nextInt();
        for (libary1 x:list){
            if (x.id==1){
                System.out.println(list.get(0).name);
            }else if (x.id==2){
                System.out.println(list.get(1).name);
            }else if (x.id==3){
                System.out.println(list.get(2).name);
            }else {
                System.out.println("没有这本书");
                //查
            }
        }



        }
            }






